package top.itmeans.yes.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;
import top.itmeans.yes.dto.*;
import top.itmeans.yes.entity.Order;

import java.util.List;

/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author Yiming.Cao
 * @since 2022-04-28
 */
public interface OrderService extends IService<Order> {

    /**
     * 根据订单查询参数和单个页面数据数量、当前页码查询
     * @param queryParam 订单查询选项
     * @param pageSize 单个页面数据数量
     * @param pageNum 当前页码
     * @return page
     */
    Page<Order> list(OrderQueryParam queryParam, Integer pageSize, Integer pageNum);
    /**
     * 批量发货
     */
    @Transactional
    int delivery(List<OrderDeliveryParam> deliveryParamList);

    /**
     * 批量关闭订单(通过修改订单状态)
     */
    @Transactional
    boolean close(List<Long> ids, String note);

    /**
     * 批量删除订单
     * @return
     */
    int delete(List<Long> ids);

    OrderDetail detail(Long id);

    /**
     * 修改订单收货人信息
     */
    @Transactional
    int receiverInfoParam(ReceiverInfoParam receiverInfoParam);

    /**
     * 修改订单费用信息
     */
    @Transactional
    int updateMoneyInfo(MoneyInfoParam moneyInfoParam);

    /**
     * 修改订单备注
     */
    @Transactional
    int updateNote(Long id, String note, Integer status);
}
